package com.yang.studentsapp;

import com.yang.studentsapp.model.IAction;
import com.yang.studentsapp.presenter.IView;

/**
 * Created by ${Ян-Вэнь-Чао} on 2016/10/13.
 */
public class PresenterBase {
    protected IView mIView;

    public PresenterBase(IView IView) {
        mIView = IView;
    }

    protected class MyAction implements IAction {

        @Override
        public void start(String msg) {
            if (mIView != null) {
                mIView.onStart(msg);
            }
        }

        @Override
        public void error(String msg) {
            if (mIView != null) {
                mIView.onError(msg);
            }
        }

        @Override
        public void fail(String msg) {
            if (mIView != null) {
                mIView.onFail(msg);
            }
        }
    }
}
